home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / Chess++ ƒ / CBrain.h < prev    next >
Text File  |  1993-05-06  |  2KB  |  57 lines

  1. /******************************************************************************
  2.  CBrain.h
  3.  
  4.         Interface for the Brain Class
  5.         
  6.         Copyright © 1993 Steven J. Bushell. All rights reserved.
  7.  
  8.  ******************************************************************************/
  9.  
  10. #define _H_CBrain
  11.  
  12. #include "CBureaucrat.h"                /* Interface for its superclass        */
  13.  
  14. CLASS CChessBoard;
  15. //CLASS CVirtualBoard;
  16.  
  17. struct CBrain : CBureaucrat {
  18.  
  19.     Boolean        isBrainsMove;    // true if it's the Brain's turn to move
  20.     Boolean        isThinking;        // true if Brain is thinking
  21.     Boolean        abortMove;        // true if we're going to swap players
  22.  
  23.     CChessBoard        *theRealBoard;        // the current 'real' board
  24.     CChessBoard        *theVirtualBoard;    // the current virtual board
  25.  
  26.     // The Brain's characteristics
  27.     short        theBrainsColor;
  28.     short        searchDepth;    // depth of Brain's thinking
  29.     Boolean        soundOnBetterMoves;
  30.     Boolean        showContemplatedMoves;
  31.     Boolean        backPropagation;    //    variable to make options dialog look good
  32.     long        backgroundTimeInterval;
  33.     long        backgroundTimeIntervalTimer;
  34.     
  35.     // instance variables used to reenter Brain multiple times without
  36.     // losing train of thought.
  37.     long        bestMoveValue;
  38.     short        testRank, testFile;
  39.     short        bestFirstClickRank, bestFirstClickFile;
  40.     short        bestSecondClickRank, bestSecondClickFile;
  41.  
  42.     // The Brain's methods
  43.     void             IBrain(CBureaucrat    *aSupervisor);
  44.     void            Dawdle(long    *maxSleep);
  45.     void            Think(void);
  46.     void            ClearThoughts(void);
  47.     short            FindMoveValue(CChessBoard *theRealBoard,
  48.                     short secondTestRank, short secondTestFile);
  49.     short            FindBestVirtualResponse(CChessBoard *theWorkingBoard,
  50.                         short theColor, short secondClickRank,
  51.                         short secondClickFile, short theSearchDepth);
  52.     Boolean            CheckForMate(void);
  53.     Boolean            CheckForStalemate(void);
  54.     CChessBoard        *CopyBoard(CChessBoard *theBoardToCopy);
  55.     void            DisposeBoard(CChessBoard *theBoardToDispose);
  56.     void            UpdateMenus(void);
  57. };